package com.man.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.man.bean.AdminMan;
import com.man.bean.People;
import com.man.dao.AdminDao;
import com.man.dao.PeopleDao;



/**
 * Servlet implementation class RegistServlet
 */
@WebServlet("/delpeo")
public class DelPeoServlet extends HttpServlet {
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		String account = request.getParameter("account");
	
		int num=new PeopleDao().delPeople(account);
		if(num==1) {
			request.getSession().setAttribute("st", "删除成功");
		
		}else {
			
			request.getSession().setAttribute("st", "删除失败");
			
		}
		request.getRequestDispatcher("/showhotel").forward( request, response);

	}

}
